package com.material.supplier.service.impl;

import java.util.List;
import com.material.common.utils.DateUtils;
import com.material.supplier.params.SupplierCarQuery;
import com.material.supplier.vo.SupplierCarVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.material.supplier.mapper.SupplierCarMapper;
import com.material.supplier.domain.SupplierCar;
import com.material.supplier.service.ISupplierCarService;

/**
 * 车辆管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-07
 */
@Service
public class SupplierCarServiceImpl implements ISupplierCarService 
{
    @Autowired
    private SupplierCarMapper supplierCarMapper;

    /**
     * 查询车辆管理
     * 
     * @param id 车辆管理主键
     * @return 车辆管理
     */
    @Override
    public SupplierCar selectSupplierCarById(Long id)
    {
        return supplierCarMapper.selectSupplierCarById(id);
    }

    /**
     * 查询车辆管理列表
     * 
     * @param supplierCar 车辆管理
     * @return 车辆管理
     */
    @Override
    public List<SupplierCar> selectSupplierCarList(SupplierCar supplierCar)
    {
        return supplierCarMapper.selectSupplierCarList(supplierCar);
    }

    @Override
    public List<SupplierCarVo> selectSupplierCarPageList(SupplierCarQuery supplierCar) {
        return supplierCarMapper.selectSupplierCarPageList(supplierCar);
    }

    /**
     * 新增车辆管理
     * 
     * @param supplierCar 车辆管理
     * @return 结果
     */
    @Override
    public int insertSupplierCar(SupplierCar supplierCar)
    {
        supplierCar.setCreateTime(DateUtils.getNowDate());
        return supplierCarMapper.insertSupplierCar(supplierCar);
    }

    /**
     * 修改车辆管理
     * 
     * @param supplierCar 车辆管理
     * @return 结果
     */
    @Override
    public int updateSupplierCar(SupplierCar supplierCar)
    {
        return supplierCarMapper.updateSupplierCar(supplierCar);
    }

    /**
     * 批量删除车辆管理
     * 
     * @param ids 需要删除的车辆管理主键
     * @return 结果
     */
    @Override
    public int deleteSupplierCarByIds(Long[] ids)
    {
        return supplierCarMapper.deleteSupplierCarByIds(ids);
    }

    /**
     * 删除车辆管理信息
     * 
     * @param id 车辆管理主键
     * @return 结果
     */
    @Override
    public int deleteSupplierCarById(Long id)
    {
        return supplierCarMapper.deleteSupplierCarById(id);
    }

    @Override
    public SupplierCar selectSupplierCarByCarNum(String carNum,Long supplierId) {
        return supplierCarMapper.selectSupplierCarByCarNum(carNum,supplierId);
    }
}
